package com.bee.baselibrary.base;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;

@SuppressLint("CommitPrefEdits")
public class ColumnValue {

    private SharedPreferences sp;
    private SharedPreferences.Editor editor;

    public ColumnValue(Context context) {
        sp = context.getSharedPreferences("beeMarket_s", Context.MODE_PRIVATE);
        editor = sp.edit();
    }


    /**
     * 是否第一次打开APP
     * @return
     */
    public boolean getIsFirst() {

        return sp.getBoolean("isFirst", true);
    }

    public void setIsFirst(boolean isFirst) {
        editor.putBoolean("isFirst", isFirst);
        editor.commit();
    }

    /**
     * 是否第一次打开APP弹出抽奖
     * @return
     */
    public boolean getIsFirstShowLuck() {

        return sp.getBoolean("isFirstShowLuck", true);
    }

    public void setIsFirstShowLuck(boolean isFirstShowLuck) {
        editor.putBoolean("isFirstShowLuck", isFirstShowLuck);
        editor.commit();
    }

    //是否登录
    public boolean getIsLogin() {

        return sp.getBoolean("isLogin", false);
    }

    public void setIsLogin(boolean isLogin) {
        editor.putBoolean("isLogin", isLogin);
        editor.commit();
    }


    //ID
    public void setId(String id) {
        editor.putString("id", id);
        editor.commit();
    }

    public String getId() {
        return sp.getString("id", "");
    }

    //Token
    public void setToken(String token) {
        editor.putString("token", token);
        editor.commit();
    }

    public String getToken() {
        return sp.getString("token", "");
    }

    //手机号****
    public void setMobileAstr(String mobileAstr) {
        editor.putString("mobileAstr", mobileAstr);
        editor.commit();
    }

    public String getMobileAstr() {
        return sp.getString("mobileAstr", "");
    }

    //用户名
    public void setUserName(String userName) {
        editor.putString("UserName", userName);
        editor.commit();
    }

    public String getUserName() {
        return sp.getString("UserName", "");
    }

    //昵称
    public void setNikeName(String nikeName) {
        editor.putString("nikeName", nikeName);
        editor.commit();
    }

    public String getNikeName() {
        return sp.getString("nikeName", "");
    }

    //头像
    public void setHeadImg(String headImg) {
        editor.putString("HeadImg", headImg);
        editor.commit();
    }

    public String getHeadImg() {
        return sp.getString("HeadImg", "");
    }
    //二维码
    public void setQRCode(String qrcode) {
        editor.putString("qrcode", qrcode);
        editor.commit();
    }

    public String getQRCode() {
        return sp.getString("qrcode", "");
    }


    //推送标示
    public void setPushAccount(String pushAccount) {
        editor.putString("push_account", pushAccount);
        editor.commit();
    }

    public String getPushAccount() {
        return sp.getString("push_account", "");
    }


    //isDeBug
    public boolean getIsFormal() {
        return sp.getBoolean("isFormal", false);
    }

    public void setIsFormal(boolean isFormal) {
        editor.putBoolean("isFormal", isFormal);
        editor.commit();
    }


}
